package flc.ast.adapter;

import androidx.annotation.NonNull;

import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.media.bean.AudioBean;

public class SelAudioAdapter extends StkProviderMultiAdapter<AudioBean> {

    public SelAudioAdapter() {
        addItemProvider(new SelAudioItemProvider());
    }

    private class SelAudioItemProvider extends BaseItemProvider<AudioBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_sel_audio;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, AudioBean bean) {
            baseViewHolder.setText(R.id.tvSelAudioName, bean.getName());
            if (bean.isSelected()) {
                baseViewHolder.setImageResource(R.id.ivSelAudioSel, R.drawable.aszyy);
            }else {
                baseViewHolder.setImageResource(R.id.ivSelAudioSel, R.drawable.awxzyy);
            }
        }
    }
}
